FROM bitnami/kafka:3.3.2

ENV  TZ=Asia/Shanghai
ENV  KAFKA_CFG_PROCESS_ROLES=controller,broker
ENV  KAFKA_CFG_NODE_ID=0
ENV  KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://:9094
ENV  KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,EXTERNAL:PLAINTEXT,PLAINTEXT:PLAINTEXT
ENV  KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka-server:9093
ENV  KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,EXTERNAL://localhost:9094
ENV  KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER



#RUN  apt update && apt  install -y  vim  grep  git  unzip  

#RUN  chmod -R 755  /bitnami/kafka

WORKDIR  /bitnami/kafka

EXPOSE 9092
EXPOSE 9093
EXPOSE 9094


### 安装目录[KAFKA_BASE_DIR | KAFKA_HOME]: /opt/bitnami/kafka
### 持久性目录[KAFKA_VOLUME_DIR]:          /bitnami/kafka
### 配置目录[KAFKA_CONF_DIR]:              /opt/bitnami/kafka/config
### 配置文件[KAFKA_CONF_FILE]:             /opt/bitnami/kafka/config/server.properties 
### 日志目录[KAFKA_LOG_DIR]:               /opt/bitnami/kafka/logs



##Windows
## docker  run --name  kafka  --hostname kafka-server  -p  9092:9092  -p  9093:9093  -p  9094:9094 -v  E:/www/docker/kafka/kafka:/bitnami/kafka -d  kafka  

##Linux
## docker  run --name  kafka  --hostname kafka-server  -p  9092:9092  -p  9093:9093  -p  9094:9094 -v  /app/www/docker/kafka/kafka:/bitnami/kafka -d  kafka  

